/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csgui.entities;

import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author robert
 */
@Entity
public class Broker extends GridSimEntity{
    @OneToMany protected Collection<User> users;
    @OneToOne protected ComputingResource computingResource;
    
    public Broker()
    {
    }

    public ComputingResource getComputingResource() {
        return computingResource;
    }

    public void setComputingResource(ComputingResource computingResource) {
        this.computingResource = computingResource;
    }
    
    public Collection<User> getUsers() {
        return users;
    }

    public void setUsers(Collection<User> users) {
        this.users = users;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Broker)) {
            return false;
        }
        Broker other = (Broker) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "csgui.entities.Broker[ id=" + id + " ]";
    }
    
}
